+2004-08-14 Tor Lillqvist <tml@iki.fi>
+
+ * gtk/gtkfilechooserdefault.c (shortcuts_append_home,
+ shortcuts_append_desktop, set_local_only)
+ * gtk/gtkfilesystemwin32.c (gtk_file_system_win32_render_icon)
+ * gtk/gtkpathbar.c (find_button_type, _gtk_path_bar_set_file_system):
+ Guard against g_get_home_dir() returning NULL. (#150007)
+
Sat Aug 14 17:56:33 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges): New function.
+2004-08-14 Tor Lillqvist <tml@iki.fi>
+
+ * gtk/gtkfilechooserdefault.c (shortcuts_append_home,
+ shortcuts_append_desktop, set_local_only)
+ * gtk/gtkfilesystemwin32.c (gtk_file_system_win32_render_icon)
+ * gtk/gtkpathbar.c (find_button_type, _gtk_path_bar_set_file_system):
+ Guard against g_get_home_dir() returning NULL. (#150007)
+
Sat Aug 14 17:56:33 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges): New function.
+2004-08-14 Tor Lillqvist <tml@iki.fi>
+
+ * gtk/gtkfilechooserdefault.c (shortcuts_append_home,
+ shortcuts_append_desktop, set_local_only)
+ * gtk/gtkfilesystemwin32.c (gtk_file_system_win32_render_icon)
+ * gtk/gtkpathbar.c (find_button_type, _gtk_path_bar_set_file_system):
+ Guard against g_get_home_dir() returning NULL. (#150007)
+
Sat Aug 14 17:56:33 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges): New function.
+2004-08-14 Tor Lillqvist <tml@iki.fi>
+
+ * gtk/gtkfilechooserdefault.c (shortcuts_append_home,
+ shortcuts_append_desktop, set_local_only)
+ * gtk/gtkfilesystemwin32.c (gtk_file_system_win32_render_icon)
+ * gtk/gtkpathbar.c (find_button_type, _gtk_path_bar_set_file_system):
+ Guard against g_get_home_dir() returning NULL. (#150007)
+
Sat Aug 14 17:56:33 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gtk/gtkentry.c (gtk_entry_get_pixel_ranges): New function.
GError *error;
home = g_get_home_dir ();
+ if (home == NULL)
+ return;
+
home_path = gtk_file_system_filename_to_path (impl->file_system, home);
error = NULL;
static void
shortcuts_append_desktop (GtkFileChooserDefault *impl)
{
+ const char *home;
char *name;
GtkFilePath *path;
- name = g_build_filename (g_get_home_dir (), "Desktop", NULL);
+ home = g_get_home_dir ();
+ if (home == NULL)
+ return;
+
+ name = g_build_filename (home, "Desktop", NULL);
path = gtk_file_system_filename_to_path (impl->file_system, name);
g_free (name);
* such a situation, so we ignore errors.
*/
const gchar *home = g_get_home_dir ();
- GtkFilePath *home_path = gtk_file_system_filename_to_path (impl->file_system, home);
+ GtkFilePath *home_path;
+
+ if (home == NULL)
+ return;
+
+ home_path = gtk_file_system_filename_to_path (impl->file_system, home);
_gtk_file_chooser_set_current_folder_path (GTK_FILE_CHOOSER (impl), home_path, NULL);
}
else if (g_file_test (filename, G_FILE_TEST_IS_DIR))
{
- if (0 == strcmp (g_get_home_dir(), filename))
+ const gchar *home = g_get_home_dir ();
+ if (home != NULL && 0 == strcmp (home, filename))
icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_HOME);
else
icon_set = gtk_style_lookup_icon_set (widget->style, GTK_STOCK_DIRECTORY);
find_button_type (GtkPathBar *path_bar,
GtkFilePath *path)
{
- if (! gtk_file_path_compare (path, path_bar->root_path))
+ if (path_bar->root_path != NULL &&
+ ! gtk_file_path_compare (path, path_bar->root_path))
return ROOT_BUTTON;
- if (! gtk_file_path_compare (path, path_bar->home_path))
+ if (path_bar->home_path != NULL &&
+ ! gtk_file_path_compare (path, path_bar->home_path))
return HOME_BUTTON;
- if (! gtk_file_path_compare (path, path_bar->desktop_path))
+ if (path_bar->desktop_path != NULL &&
+ ! gtk_file_path_compare (path, path_bar->desktop_path))
return DESKTOP_BUTTON;
return NORMAL_BUTTON;
path_bar->file_system = g_object_ref (file_system);
home = g_get_home_dir ();
- desktop = g_build_filename (home, "Desktop", NULL);
- path_bar->home_path = gtk_file_system_filename_to_path (path_bar->file_system, home);
- path_bar->desktop_path = gtk_file_system_filename_to_path (path_bar->file_system, desktop);
+ if (home != NULL)
+ {
+ path_bar->home_path = gtk_file_system_filename_to_path (path_bar->file_system, home);
+ /* FIXME: Need file system backend specific way of getting the
+ * Desktop path.
+ */
+ desktop = g_build_filename (home, "Desktop", NULL);
+ path_bar->desktop_path = gtk_file_system_filename_to_path (path_bar->file_system, desktop);
+ g_free (desktop);
+ }
+ else
+ {
+ path_bar->home_path = NULL;
+ path_bar->desktop_path = NULL;
+ }
path_bar->root_path = gtk_file_system_filename_to_path (path_bar->file_system, "/");
- g_free (desktop);
}
/**